home *** CD-ROM | disk | FTP | other *** search
- package sun.font;
-
- import java.awt.Font;
- import java.awt.font.FontRenderContext;
- import java.awt.geom.AffineTransform;
-
- public final class GlyphLayout$GVData {
- public int _count;
- public int _flags;
- public int[] _glyphs;
- public float[] _positions;
- public int[] _indices;
- private static final int UNINITIALIZED_FLAGS = -1;
-
- public void init(int var1) {
- this._count = 0;
- this._flags = -1;
- if (this._glyphs == null || this._glyphs.length < var1) {
- if (var1 < 20) {
- var1 = 20;
- }
-
- this._glyphs = new int[var1];
- this._positions = new float[var1 * 2 + 2];
- this._indices = new int[var1];
- }
-
- }
-
- public void grow() {
- this.grow(this._glyphs.length / 4);
- }
-
- public void grow(int var1) {
- int var2 = this._glyphs.length + var1;
- int[] var3 = new int[var2];
- System.arraycopy(this._glyphs, 0, var3, 0, this._count);
- this._glyphs = var3;
- float[] var4 = new float[var2 * 2 + 2];
- System.arraycopy(this._positions, 0, var4, 0, this._count * 2 + 2);
- this._positions = var4;
- int[] var5 = new int[var2];
- System.arraycopy(this._indices, 0, var5, 0, this._count);
- this._indices = var5;
- }
-
- public void adjustPositions(AffineTransform var1) {
- var1.transform(this._positions, 0, this._positions, 0, this._count);
- }
-
- public StandardGlyphVector createGlyphVector(Font var1, FontRenderContext var2, StandardGlyphVector var3) {
- if (this._flags == -1) {
- this._flags = 0;
- if (this._count > 1) {
- boolean var4 = true;
- boolean var5 = true;
- int var6 = this._count;
-
- for(int var7 = 0; var7 < this._count && (var4 || var5); ++var7) {
- boolean var10000;
- label54: {
- int var8 = this._indices[var7];
- var4 = var4 && var8 == var7;
- if (var5) {
- --var6;
- if (var8 == var6) {
- var10000 = true;
- break label54;
- }
- }
-
- var10000 = false;
- }
-
- var5 = var10000;
- }
-
- if (var5) {
- this._flags |= 4;
- }
-
- if (!var5 && !var4) {
- this._flags |= 8;
- }
- }
-
- this._flags |= 2;
- }
-
- int[] var9 = new int[this._count];
- System.arraycopy(this._glyphs, 0, var9, 0, this._count);
- float[] var10 = null;
- if ((this._flags & 2) != 0) {
- var10 = new float[this._count * 2 + 2];
- System.arraycopy(this._positions, 0, var10, 0, var10.length);
- }
-
- int[] var11 = null;
- if ((this._flags & 8) != 0) {
- var11 = new int[this._count];
- System.arraycopy(this._indices, 0, var11, 0, this._count);
- }
-
- if (var3 == null) {
- var3 = new StandardGlyphVector(var1, var2, var9, var10, var11, this._flags);
- } else {
- var3.initGlyphVector(var1, var2, var9, var10, var11, this._flags);
- }
-
- return var3;
- }
- }
-